<!-- HTML header for doxygen 1.8.10-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<title>NATS C Client with JetStream and Streaming support: Libevent Adapter</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="customdoxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;" >
   <div id="projectname">NATS C Client with JetStream and Streaming support
   &#160;<span id="projectnumber">3.10.0-beta</span>
   </div>
   <div id="projectbrief">The nats.io C Client, Supported by Synadia Communications Inc.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__libevent_functions.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">Libevent Adapter</div></div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga195d269473332931fd0fede0bac3309e" id="r_ga195d269473332931fd0fede0bac3309e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libevent_functions.html#ga195d269473332931fd0fede0bac3309e">natsLibevent_Init</a> (void)</td></tr>
<tr class="memdesc:ga195d269473332931fd0fede0bac3309e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the adapter.  <br /></td></tr>
<tr class="separator:ga195d269473332931fd0fede0bac3309e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga30c00f21a5251ee9fde09c1f2b429cd2" id="r_ga30c00f21a5251ee9fde09c1f2b429cd2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libevent_functions.html#ga30c00f21a5251ee9fde09c1f2b429cd2">natsLibevent_Attach</a> (void **userData, void *loop, <a class="el" href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec">natsConnection</a> *nc, <a class="el" href="nats_8h.html#af798865ac824e5959987de0fe8d07383">natsSock</a> socket)</td></tr>
<tr class="memdesc:ga30c00f21a5251ee9fde09c1f2b429cd2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Attach a connection to the given event loop.  <br /></td></tr>
<tr class="separator:ga30c00f21a5251ee9fde09c1f2b429cd2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8a14ce23b4f6ba3bf63369961f9a5552" id="r_ga8a14ce23b4f6ba3bf63369961f9a5552"><td class="memItemLeft" align="right" valign="top"><a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libevent_functions.html#ga8a14ce23b4f6ba3bf63369961f9a5552">natsLibevent_Read</a> (void *userData, bool add)</td></tr>
<tr class="memdesc:ga8a14ce23b4f6ba3bf63369961f9a5552"><td class="mdescLeft">&#160;</td><td class="mdescRight">Start or stop polling on READ events.  <br /></td></tr>
<tr class="separator:ga8a14ce23b4f6ba3bf63369961f9a5552"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7ac99f326a59e5663ff66f5023c87091" id="r_ga7ac99f326a59e5663ff66f5023c87091"><td class="memItemLeft" align="right" valign="top"><a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libevent_functions.html#ga7ac99f326a59e5663ff66f5023c87091">natsLibevent_Write</a> (void *userData, bool add)</td></tr>
<tr class="memdesc:ga7ac99f326a59e5663ff66f5023c87091"><td class="mdescLeft">&#160;</td><td class="mdescRight">Start or stop polling on WRITE events.  <br /></td></tr>
<tr class="separator:ga7ac99f326a59e5663ff66f5023c87091"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaac76f5937329a8650f69c6bd8af36cd5" id="r_gaac76f5937329a8650f69c6bd8af36cd5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__libevent_functions.html#gaac76f5937329a8650f69c6bd8af36cd5">natsLibevent_Detach</a> (void *userData)</td></tr>
<tr class="memdesc:gaac76f5937329a8650f69c6bd8af36cd5"><td class="mdescLeft">&#160;</td><td class="mdescRight">The connection is closed, it can be safely detached.  <br /></td></tr>
<tr class="separator:gaac76f5937329a8650f69c6bd8af36cd5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Adapter to plug a <code>NATS</code> connection to a <code>libevent</code> event loop. </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga195d269473332931fd0fede0bac3309e" name="ga195d269473332931fd0fede0bac3309e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga195d269473332931fd0fede0bac3309e">&#9670;&#160;</a></span>natsLibevent_Init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void natsLibevent_Init </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Needs to be called once so that the adapter can initialize some state. </p>

</div>
</div>
<a id="ga30c00f21a5251ee9fde09c1f2b429cd2" name="ga30c00f21a5251ee9fde09c1f2b429cd2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga30c00f21a5251ee9fde09c1f2b429cd2">&#9670;&#160;</a></span>natsLibevent_Attach()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> natsLibevent_Attach </td>
          <td>(</td>
          <td class="paramtype">void **&#160;</td>
          <td class="paramname"><em>userData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>loop</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec">natsConnection</a> *&#160;</td>
          <td class="paramname"><em>nc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="nats_8h.html#af798865ac824e5959987de0fe8d07383">natsSock</a>&#160;</td>
          <td class="paramname"><em>socket</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This callback is invoked after <code>NATS</code> library has connected, or reconnected. For a reconnect event, <code>*userData</code> will not be <code>NULL</code>. This function will start polling on READ events for the given <code>socket</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">userData</td><td>the location where the adapter stores the user object passed to the other callbacks. </td></tr>
    <tr><td class="paramname">loop</td><td>the event loop as a generic pointer. Cast to appropriate type. </td></tr>
    <tr><td class="paramname">nc</td><td>the connection to attach to the event loop </td></tr>
    <tr><td class="paramname">socket</td><td>the socket to start polling on. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga8a14ce23b4f6ba3bf63369961f9a5552" name="ga8a14ce23b4f6ba3bf63369961f9a5552"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8a14ce23b4f6ba3bf63369961f9a5552">&#9670;&#160;</a></span>natsLibevent_Read()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> natsLibevent_Read </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>userData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>add</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This callback is invoked to notify that the event library should start or stop polling for READ events.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">userData</td><td>the user object created in <a class="el" href="group__libevent_functions.html#ga30c00f21a5251ee9fde09c1f2b429cd2" title="Attach a connection to the given event loop.">natsLibevent_Attach</a> </td></tr>
    <tr><td class="paramname">add</td><td><code>true</code> if the library needs to start polling, <code>false</code> otherwise. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga7ac99f326a59e5663ff66f5023c87091" name="ga7ac99f326a59e5663ff66f5023c87091"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7ac99f326a59e5663ff66f5023c87091">&#9670;&#160;</a></span>natsLibevent_Write()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> natsLibevent_Write </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>userData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>add</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This callback is invoked to notify that the event library should start or stop polling for WRITE events.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">userData</td><td>the user object created in <a class="el" href="group__libevent_functions.html#ga30c00f21a5251ee9fde09c1f2b429cd2" title="Attach a connection to the given event loop.">natsLibevent_Attach</a> </td></tr>
    <tr><td class="paramname">add</td><td><code>true</code> if the library needs to start polling, <code>false</code> otherwise. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gaac76f5937329a8650f69c6bd8af36cd5" name="gaac76f5937329a8650f69c6bd8af36cd5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaac76f5937329a8650f69c6bd8af36cd5">&#9670;&#160;</a></span>natsLibevent_Detach()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> natsLibevent_Detach </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>userData</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>When a connection is closed (not disconnected, pending a reconnect), this callback will be invoked. This is the opportunity to cleanup the state maintained by the adapter for this connection.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">userData</td><td>the user object created in <a class="el" href="group__libevent_functions.html#ga30c00f21a5251ee9fde09c1f2b429cd2" title="Attach a connection to the given event loop.">natsLibevent_Attach</a> </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.10-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">NATS.IO Supported By Synadia Communications Inc.
    <a href="http://www.nats.io">
    </a></li>
  </ul>
</div>
</body>
</html>
